//
//  DTMainBaseTabBarViewController.m
//  DoThinkProperty
//
//  Created by YangJian on 15/9/23.
//  Copyright (c) 2015年 DoThink. All rights reserved.
//

#import "DTMainBaseTabBarViewController.h"
#import "DTHomeMainTableViewController.h"
#import "DTNeighboursMainTableViewController.h"
#import "DTCommunityMainTableViewController.h"
@interface DTMainBaseTabBarViewController ()

@end

@implementation DTMainBaseTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpAllChildViewController];
    // Do any additional setup after loading the view.
}

- (void)setUpAllChildViewController{
    DTHomeMainTableViewController *firstVC = [[DTHomeMainTableViewController alloc] init];
    [self setUpOneChildViewController:firstVC image:[UIImage imageNamed:@"tb_personal@3x.png"] title:@"物业"];
    
    DTCommunityMainTableViewController *secondVC = [[DTCommunityMainTableViewController alloc] init];
    [self setUpOneChildViewController:secondVC image:[UIImage imageNamed:@"tb_hand-ring@3x.png"] title:@"聚邻"];
    
    DTNeighboursMainTableViewController *thirdVC = [[DTNeighboursMainTableViewController alloc] init];
    [self setUpOneChildViewController:thirdVC image:[UIImage imageNamed:@"tb_class@2x.png"] title:@"朋友"];
    
    
}

- (void)setUpOneChildViewController:(UIViewController *)viewController image:(UIImage *)image title:(NSString *)title{
    UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:viewController];
    navC.title = title;
    navC.tabBarItem.image = image;
    [navC.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_nav.png"] forBarMetrics:UIBarMetricsDefault];
    viewController.navigationItem.title = title;
    [self addChildViewController:navC];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
